import 'package:flutter/material.dart';
import 'package:flutter_juwo/common/common_index.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/ts/home/home_view.dart';
import 'package:flutter_juwo/ui/utils/utils.dart';

/// Created by DongKing on 2020/10/9
/// Version 1.0
/// Describe:推手首页
class PushHome extends StatefulWidget {
  @override
  _PushHomeState createState() => _PushHomeState();
}

class _PushHomeState extends State<PushHome> {
  @override
  void initState() {
    super.initState();
    Utils.init(context); //初始化全局context
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colours.cbg,
      body: _body(),
    );
  }

  _body() {
    return Column(
      children: <Widget>[
        HomeView.titleBar(
            "首页",
            "https://pic2.zhimg.com/v2-c4e91951d8fc79471a79acbadde3b59a_r.jpg?source=1940ef5c",
            "李强"),
        _list()
      ],
    );
  }

  _list() {
    return Expanded(
      child: ListView(
        padding: UiUtils.edgeOnly(t: 0),
        shrinkWrap: true,
        children: <Widget>[
          //看板数据
          HomeView.kanban(
            money: 25555,
            unReceivedMoney: 36500.00,
            allMoney: 3697841,
            inviteNum: 150,
            makeNum: 120,
            makeRate: 60,
            makeNum7: 30,
            makeRate7: 30,
            unMakeNum: 30,
            unMakeRate: 60,
          ),
          //做单统计
          // HomeView.census(
          //     ["01", "02", "03", "04", "05", "06"], [5, 20, 36, 10, 10, 20]),

          HomeView.census2([
            {"x": 1, "y": 19},
            {"x": 2, "y": 19},
            {"x": 3, "y": 19},
            {"x": 4, "y": 19},
            {"x": 5, "y": 10},
            {"x": 6, "y": 16},
            {"x": 7, "y": 40},
            {"x": 8, "y": 18},
            {"x": 9, "y": 18},
            {"x": 10, "y": 30},
            {"x": 11, "y": 18},
            {"x": 12, "y": 50},
            {"x": 13, "y": 40},
            {"x": 14, "y": 40},
            {"x": 15, "y": 35}
          ],
              [
                {"x": 1, "y": 6},
                {"x": 2, "y": 8},
                {"x": 3, "y": 10},
                {"x": 4, "y": 3},
                {"x": 5, "y": 8},
                {"x": 6, "y": 26},
                {"x": 7, "y": 19},
                {"x": 8, "y": 18},
                {"x": 9, "y": 18},
                {"x": 10, "y": 16},
                {"x": 11, "y": 18},
                {"x": 12, "y": 30},
                {"x": 13, "y": 13},
                {"x": 14, "y": 16},
                {"x": 15, "y": 10}
              ]),
          // HomeView.shareSetting(
          //     "https://pub.flutter-io.cn/packages/charts_flutter/versions/0.9.0"),
          HomeView.activity([
            {
              "url":
                  "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1602503176357&di=f90bb5b86e11ef2e90492e55c91103d4&imgtype=0&src=http%3A%2F%2Fwx3.sinaimg.cn%2Flarge%2F006VYTdfgy1g0hvon8hnij30ls0c9n9d.jpg",
              "title": "直接邀请活动",
              "time": "2020/07/01至2020/07/20",
              "msg": "直接邀请好友做单，淘宝天猫单，直接邀请奖励0.5金..."
            },
            {
              "url":
                  "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1602503176357&di=f90bb5b86e11ef2e90492e55c91103d4&imgtype=0&src=http%3A%2F%2Fwx3.sinaimg.cn%2Flarge%2F006VYTdfgy1g0hvon8hnij30ls0c9n9d.jpg",
              "title": "直接邀请活动",
              "time": "2020/07/01至2020/07/20",
              "msg": "直接邀请好友做单，淘宝天猫单，直接邀请奖励0.5金..."
            }
          ])
        ],
      ),
    );
  }
}
